package com.fs.common.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fs.common.annotation.ColumnDesc;
import com.fs.common.utils.StringTools;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @author ACE
 * @desc 实体对象实体类
 * @creationTime 2019-03-30 15:00
 * @projectName weixinframe
 * @packageName com.fs.pojo
 */
@Data
@TableName("s_modle")
@EqualsAndHashCode(callSuper=false)
@AllArgsConstructor
@NoArgsConstructor
public class Modle extends IdEntity{
	@ColumnDesc(name = "cless名称")
	private String className;

	@ColumnDesc(name = "模块名称")
	private String modleName;
	
	public static Modle newInstance(String className){
		String[] datas = className.split("\\.");
		String modleName = datas[datas.length-1];
		modleName = StringTools.toLowerCaseFirstOne(modleName);
		return new Modle(className, modleName);
	}
}
